package leetcode_201_300;

import com.sun.xml.internal.bind.v2.model.core.ID;

public class LeeCode_231 {
    public static void main(String[] args) {
        System.out.println(isPowerOfTwo(8));
    }
    private static boolean isPowerOfTwo(int n) {
        long t = 1;
        while (t < Integer.MAX_VALUE){
            if (n == t)
                return true;
            t = t << 1;
        }
        return false;
    }
}
